package com.authine.cloudpivot.ext.enums;

/**
 * @program: gm-market
 * @description:
 * @author: wlw
 * @create: 2021-08-26 15:57
 **/
public enum  GoodsTypeEnum {
    Mall("0","固买市场"),
    Single("1","单次采购"),
    Loop("2","多次采购"),
    Virtual("3","虚拟商品"),
    EnterpriseMall("4","企业商品");;
    private String code;
    private String desc;

    GoodsTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GoodsTypeEnum get(String code) {

        for (GoodsTypeEnum c : GoodsTypeEnum.values()) {
            if (c.getCode().equals(code)) {
                return c;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
